home *** CD-ROM | disk | FTP | other *** search
-
- The L-system parser is based on Laurens Lapre source code.
- Web page: http://home.wanadoo.nl/laurens.lapre/lparser.htm
-
- The source code may be freely distributed, as as stated in above page:
-
- "Source code of the lparser ZIP file (18Kb) can also be downloaded,
- for those who want to port or just play with new options. The code
- is straight, no frills ANSI-C with even less documentation but it
- should run on pretty much anything with a C or C++ compiler. My
- current job will leave me with neither the time nor the inclination
- to do serious code hacking so I'm throwing the code into the wind,
- hoping that it will germinate and produce lots of mutated offspring !
- The Lparser source may be freely distributed."
-
- The L-System example files are from the LParser package available
- from the same website.
-
- Here is a sample of the documentation that applies to borrowed code:
-
-
- More info ...
- ---------------------------------------------------------------------------
- The book 'Evolutionary Art and Computers' by S. Todd and W. Latham was used
- to base the genetic 3d form mutation principles on. In here you'll find a lot
- of interesting ideas on how to 'grow' and 'evolve' organic looking 3d forms
- of your own. ISBN 0-12-437185-X
-
- The implemented l-system is based on the one described in the book : 'The
- Algorithmic Beauty of Plants' (ABOP) by P. Prusinkiewicz and A. Lindenmayer
- (this is where the 'L' from l-systems come from). If you want more
- information on making your own l-systems you'll want to check out this book.
- A lot can be done by changing the l-systems suplied with the parser and
- seeing for yourself what changes in the final form. ISBN 0-387-97297-8
-
-
- Syntax and movement
- ---------------------------------------------------------------------------
- For those who are already familiar with l-systems, here are the commands and
- their functions for this lparser's 'dialect'. All commands are 1 char only
- and simpler then for most lparsers. This is to keep them from getting
- 'broken' by the mutation process and speeds up the parsing.
-
- There is also the posibilty to add an argument to a command. Instead
- off doing +++ one can do +(30) if the basic angle was 10 degrees. The
- argument can be a real value.
-
- The tropism command will allow you to let gravity pull branches downward by
- adding a 't' element togeter with and 'F'. See the file 'tropism.ls' and
- 'tree*.ls' for examples. When you are not sure about the current 'down'
- direction do a '$' command first. This will roll the turtle horizontal and
- make sure the current up vector is oriented in the positive z-axis direction.
-
- The turtle will start at the origin with the Z-axis as forward direction and
- Y-axis as left direction. See the file 'axis.ls' for an detailed example.
- Here you can experiment with the basic orientations and see how the 3d
- turtle is using a 'right-handed' coordinate system. Use your right hand with
- your thumb as up, forefinger as forward and an other finger as left
- direction.
-
- By adding &(90) in front of an axiom the turtle axis will align with the
- right handed coordinate system used in the viewer. Adding an additional
- +(90) will make it easier when working with 2d l-systems. See the
- 'fract*.ls' files for examples.
-
- Values can have some randomness automaticly added to them. Using ~(xx) will
- now add a random direction component to the current orientation with maximum
- of xx in all three directions. This way you can mark at which locations in
- your l-system 'jitter' needs to be introduced. Using this option no two
- 'intances' of the same l-system will look the same. See fern.ls for an
- example.
-
-
- ---------------------------------------------------------------------------
- Turtle Orientation commands
- ---------------------------------------------------------------------------
- + turn left around up vector
- +(x) turn x left around up vector
- - turn right around up vector
- -(x) turn x right around up vector
- & pitch down around left vector
- &(x) pitch x down around left vector
- ^ pitch up around left vector
- ^(x) pitch x up around left vector
- < roll left (counter clockwise) around forward vector
- <(x) roll x left around forward vector
- > roll right (clockwise) around forward vector
- >(x) roll x right around forward vector
-
- ---------------------------------------------------------------------------
- Special Orientation commands
- ---------------------------------------------------------------------------
- | turn 180 deg around up vector
- % roll 180 deg around forward vector
- $ roll until horizontal
- ~ turn/pitch/roll in a random direction
- ~(x) " in a random direction with a maximum of x degrees
- t correction for gravity with 0.2
- t(x) correction for gravity with x
-
- ---------------------------------------------------------------------------
- Movement commands when {} active
- ---------------------------------------------------------------------------
- F move forward and draw full length record vertex
- F(x) move x forward and draw record vertex
- Z move forward and draw half length record vertex
- Z(x) move x forward and draw record vertex
- f move forward with full length record vertex
- f(x) move x forward record vertex
- z move forward with half length record vertex
- z(x) move x forward record vertex
- g move forward with full length don't record vertex
- g(x) move x forward don't record vertex
- . don't move record vertex
-
- ---------------------------------------------------------------------------
- Structure commands
- ---------------------------------------------------------------------------
- [ push current state
- ] pop current state
- { start polygon shape
- } end polygon shape
-
- ---------------------------------------------------------------------------
- Inc/Dec commands
- ---------------------------------------------------------------------------
- " increment length with 1.1
- ' decrement length with 0.9
- "(x) multiply length with x also '(x)
- ; increment angle with 1.1
- : decrement angle with 0.9
- :(x) multiply angle with x also ;(x)
- ? increment thickness with 1.4
- ! decrement thickness with 0.7
- ?(x) multiply thickness with x also !(x)
-
- ---------------------------------------------------------------------------
- Additional commands
- ---------------------------------------------------------------------------
- c increment color index
- c(x) set color index to x
- @ end of object
- ---------------------------------------------------------------------------
-
-
- Disclaimer copyrights the software to RenderStar Tecyhnology BV, but tells
- nothing about either documentation or sample files; neither RenderStar nor
- Laurens Lapre could be contacted, so files are assumed freely distributable
- for any purpose:
-
- This software is free and may be freely distributed, but is copyrighted by
- the company RenderStar Technology BV. This software is provided as is
- without any guarantees. The author and company assume no liability for
- damages, direct or consequential, which may result from the use of this
- software. The 'lparser.exe' file may not be used as part of any commercial
- package without the explicit written consent of the author or company.
-
-
-